<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<title>新增和更新界面</title>
		<link rel="stylesheet" type="text/css" href="../css/api.css"/>
		<link rel="stylesheet" type="text/css" href="../css/common.css"/>
		<style>
			body {
			}
			.white-list-nav-top {
				text-align: center;
				height: 44px;
				line-height: 44px;
				background-color: #ff9f00;
				color: #fffefe;
				font-size: 18px;
				padding: 0 15px;
			}
			.white-list-nav-top > .white-list-nav-top-sub {
				color: #fff;
				display: inline-block;
				overflow: hidden;
				min-width: 50px;
				text-align: center;
			}
			.white-list-nav-top > .white-list-btn-exit {
				float: left;
				background: url(../image/icon_left_arrow_white.png) no-repeat center left;
				background-size: 10px 15px;
				margin-top: 12px;
				min-height: 20px;
			}
			.white-list-nav-top > .white-list-nav-top-title {
			}
			.white-list-nav-top > .white-list-nav-top-right-msg {
				float: right;
				text-align: right;
			}
			.main {
				background-color: #fff;
			}
			.main > .main-sub {
				text-align: left;
				padding: 0 15px;
				height: 30px;
				padding-top: 15px;
			}
			.main-sub  .main-input-box {
				height: 30px;
				line-height: 30px;
				border-radius: 4px;
				border: #C2C2C2 1px solid;
			}
			.main-sub  .main-input-box  .main-input {
				outline: none;
				color: #101010;
				font-size: 15px;
				padding-left: 15px;
				line-height: 20px;
			}
			.main-input-title {
				color: #999;
				font-size: 15px;
				height: 32px;
				line-height: 32px;
			}
			.main-sub-c1 {
				float: left;
				width: 20%;
			}
			.main-sub-c2 {
				float: left;
				width: 80%;
			}
			.white-list-footer {
				background-color: #fff;
				text-align: center;
				height: 20px;
				padding: 20px;
			}
			.white-list-footer > .footer-sub {
				text-align: left;
				display: inline-block;
				/*width: 80px;*/
				min-height: 20px;
				background-repeat: no-repeat;
				background-position: center left;
				background-size: 20px 20px;
				padding-left: 35px;
				color: #999;
			}
			.white-list-footer > .white-list-valid {
				float: left;
				background-image: url(../image/icon_valid.png);
			}
			.white-list-footer > .white-list-valid.active {
				background-image: url(../image/icon_valid_selected.png);
			}
			.white-list-footer > .white-list-not-act {
				background-image: url(../image/icon_not_active.png);
			}
			.white-list-footer > .white-list-not-act.active {
				background-image: url(../image/icon_not_active_selected.png);
			}
			.white-list-footer > .white-list-stop {
				float: right;
				background-image: url(../image/icon_stop.png);
			}
			.white-list-footer > .white-list-stop.active {
				background-image: url(../image/icon_stop_selected.png);
			}
			/* 身份选择框 */
			.identity-select-view {
				position: absolute;
			}
			.identity-select-view > .identity-select-view-sub:nth-child(1) {
				border-radius: 4px 4px 0 0;
				background-color: #03a9f4;
				color: #fff;
				border-top: #C2C2C2 1px solid;
				border-left: #C2C2C2 1px solid;
				border-right: #C2C2C2 1px solid;
			}
			.identity-select-view > .identity-select-view-sub:nth-child(2) {
				border-radius: 0 0 4px 4px;
				background-color: #f7f7f7;
				color: #101010;
				border-bottom: #C2C2C2 1px solid;
				border-left: #C2C2C2 1px solid;
				border-right: #C2C2C2 1px solid;
			}
			.identity-select-view-sub {
				height: 43px;
				font-size: 15px;
				padding: 0 15px;
				line-height: 43px;
			}
		</style>
	</head>
	<body>
		<header class="white-list-nav-top">
			<div class="white-list-nav-top-sub white-list-btn-exit"></div>
			<div class="white-list-nav-top-sub white-list-nav-top-title">
				新增
			</div>
			<div class="white-list-nav-top-sub white-list-nav-top-right-msg" id="btn-commit">
				保存
			</div>
		</header>
		<div id="lhjdb-add-update-temp" style="display: none;">
			<div class="main-sub">
				<div class="main-sub-c1">
					<div class="main-sub-contnet main-input-title">
						手机号:
					</div>
				</div>
				<div class="main-sub-c2">
					<div class="main-sub-contnet main-input-box">
						<input class="main-input main-input-phone" type="text" placeholder="输入手机号"/>
					</div>
				</div>
			</div>
		</div>
		<div class="main"></div>
		<div class="white-list-footer">
			<div class="footer-sub white-list-valid active">
				有效
			</div>
			<div class="footer-sub white-list-not-act">
				未激活
			</div>
			<div class="footer-sub white-list-stop">
				删除
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../script/api.js"></script>
	<script type="text/javascript" src="../script/common.js"></script>
	<script type="text/javascript" src="../script/jquery-3.1.1.min.js"></script>
	<script type="text/javascript" src="../script/laydate/laydate.js"></script>
	<script type="text/javascript" src="../script/request.js"></script>
	<script type="text/javascript">
		var areaID;
		//有效
		var mValidView;
		//未激活
		var mNotActiveView;
		//停用
		var mStopView;
		//状态,用来上传到服务器
		var mStatus = 0;
		//初始数据
		var mDatas;
		apiready = function() {
			$api.fixStatusBar($api.dom('header'));
			initData();
			initView();
		};
		function initData() {
			mDatas = api.pageParam;
			var countX = 0;
			for (var x in mDatas) {
				countX++;
				break;
			}
			if (countX == 0) {
				mDatas = null;
			}
		}

		function initView() {
			areaID = $api.getStorage('areaID');
			var navTitle = document.getElementsByClassName('white-list-nav-top-title')[0];
			var mainView = document.getElementsByClassName('main')[0];
			var clickBack = document.getElementsByClassName('white-list-btn-exit')[0];
			mValidView = document.getElementsByClassName('white-list-valid')[0];
			mNotActiveView = document.getElementsByClassName('white-list-not-act')[0];
			mStopView = document.getElementsByClassName('white-list-stop')[0];
			clickBack.onclick = function() {
				api.closeWin({
				});
			}
			//初始化不同区域的view
			if (areaID == AREAID_SZY) {
				initSZYView(mainView);
			} else if (areaID == AREAID_NSJDB || areaID == AREAID_CWW) {
				initNSJDBView(mainView,areaID);
			} else if (areaID == AREAID_LHJDB || areaID == AREAID_BNCZJ || areaID == AREAID_QY ) {
				initLHJDBView(mainView);
			}
			//如果初始数据为null，那么就是“新增”，反之是“更新”
			if (mDatas == null) {
				navTitle.innerText = '新增';
			} else {
				navTitle.innerText = '更新';
			}
		}

		function initLHJDBView(view) {
			//三种状态的变化(点击后的变化)
			mValidView.onclick = function() {
				mValidView.className = 'footer-sub white-list-valid active';
				mNotActiveView.className = 'footer-sub white-list-not-act';
				mStopView.className = 'footer-sub white-list-stop';
				mStatus = 2;
			}
			mNotActiveView.onclick = function() {
				mValidView.className = 'footer-sub white-list-valid';
				mNotActiveView.className = 'footer-sub white-list-not-act active';
				mStopView.className = 'footer-sub white-list-stop';
				mStatus = 1;
			}
			mStopView.onclick = function() {
				mValidView.className = 'footer-sub white-list-valid';
				mNotActiveView.className = 'footer-sub white-list-not-act';
				mStopView.className = 'footer-sub white-list-stop active';
				mStatus = 3;
			}
			//需要输入内容的布局
			view.innerHTML = document.getElementById('lhjdb-add-update-temp').innerHTML;
			var phone = view.getElementsByClassName('main-input-phone')[0];
			var commit = document.getElementById('btn-commit');
			//mDatas是否为null,是“新增页面”,反之为“更新页面”
			if (mDatas != null) {
				//从user_name获取电话号码
					phone.value = dataFaultTolerant(mDatas.user_phone);
				//状态，用以判断初始状态，来显示不同的初始view(状态)
				var status = mDatas.status;
				//状态，用以判断初始状态，来显示不同的初始view(状态)
				if (status == 1) {
					mNotActiveView.onclick();
				} else if (status == 2){
					mValidView.onclick();
				} else if (status == 3){
					mStopView.onclick();
				}
			} else {
				//“添加”界面，默认状态为“有效”
				mValidView.onclick();
			}
			commit.onclick = function() {
				//如果初始数据为null，就执行添加，反之，执行更新
				//上传的参数电话和姓名key和value互调
				if (mDatas == null) {
					addRequestNSJDB(phone.value, phone.value,"");
				} else {
					updateRequestNSJDB(phone.value, phone.value,"");
				}
			}
		}

		//初始化南山街道办view
		function initNSJDBView(view,areaId) {
			//三种状态的变化(点击后的变化)
		  	mValidView.onclick = function() {
				mValidView.className = 'footer-sub white-list-valid active';
				mNotActiveView.className = 'footer-sub white-list-not-act';
				mStopView.className = 'footer-sub white-list-stop';
				mStatus = 2;
			}
			mNotActiveView.onclick = function() {
				mValidView.className = 'footer-sub white-list-valid';
				mNotActiveView.className = 'footer-sub white-list-not-act active';
				mStopView.className = 'footer-sub white-list-stop';
				mStatus = 1;
			}
			mStopView.onclick = function() {
				mValidView.className = 'footer-sub white-list-valid';
				mNotActiveView.className = 'footer-sub white-list-not-act';
				mStopView.className = 'footer-sub white-list-stop active';
				mStatus = 3;
			}

			if(areaId == AREAID_NSJDB){
				//需要输入内容的布局
				view.innerHTML = '<div class="main-sub">' + '<div class="main-sub-c1">' + '<div class="main-sub-contnet main-input-title">姓&emsp;名:</div>' + '</div>' + '<div class="main-sub-c2">' + '<div class="main-sub-contnet main-input-box"><input class="main-input main-input-name" type="text" placeholder="输入姓名"/></div>' + '</div>' + '</div>' + '<div class="main-sub">' + '<div class="main-sub-c1">' + '<div class="main-sub-contnet main-input-title">手机号:</div>' + '</div>' + '<div class="main-sub-c2">' + '<div class="main-sub-contnet main-input-box"><input class="main-input main-input-phone" type="text" placeholder="输入手机号"/></div>' + '</div>' + '</div>';
				var name = view.getElementsByClassName('main-input-name')[0];
				var phone = view.getElementsByClassName('main-input-phone')[0];
			}else if(areaId == AREAID_CWW){
				//需要输入内容的布局
        view.innerHTML = '<div class="main-sub">' + '<div class="main-sub-c1">' + '<div class="main-sub-contnet main-input-title">姓&emsp;名:</div>' + '</div>' + '<div class="main-sub-c2">' + '<div class="main-sub-contnet main-input-box"><input class="main-input main-input-name" type="text" placeholder="输入姓名"/></div>' + '</div>' + '</div>' + '<div class="main-sub">' + '<div class="main-sub-c1">' + '<div class="main-sub-contnet main-input-title">手机号:</div>' + '</div>' + '<div class="main-sub-c2">' + '<div class="main-sub-contnet main-input-box"><input class="main-input main-input-phone" type="text" placeholder="输入手机号"/></div>' + '</div>' + '</div>' + '<div class="main-sub">' + '<div class="main-sub-c1">' + '<div class="main-sub-contnet main-input-title">密码:</div>' + '</div>' + '<div class="main-sub-c2">' + '<div class="main-sub-contnet main-input-box"><input class="main-input main-input-password" type="text" placeholder="输密码"/></div>' + '</div>' + '</div>';
				var name = view.getElementsByClassName('main-input-name')[0];
				var phone = view.getElementsByClassName('main-input-phone')[0];
				var password = view.getElementsByClassName('main-input-password')[0];
			}

			var commit = document.getElementById('btn-commit');
			//mDatas是否为null,是“新增页面”,反之为“更新页面”
			if (mDatas != null) {
				name.value = dataFaultTolerant(mDatas.user_name);
				phone.value = dataFaultTolerant(mDatas.user_phone);
				if(areaId == AREAID_CWW){
				password.value = dataFaultTolerant(mDatas.password);
				}
				//状态，用以判断初始状态，来显示不同的初始view(状态)
				var status = mDatas.status;
				//状态，用以判断初始状态，来显示不同的初始view(状态)
				if (status == 1) {
					mNotActiveView.onclick();
				} else if (status == 2) {
					mValidView.onclick();
				} else if (status == 3) {
					mStopView.onclick();
				}
			} else {
				//“添加”界面，默认状态为“有效”
				mValidView.onclick();
			}

			commit.onclick = function() {
				//如果初始数据为null，就执行添加，反之，执行更新
				if(areaId == AREAID_CWW){
					 var passwordValue = password.value;
				}else {
					 var passwordValue = '';
				}
				if (mDatas == null) {
					addRequestNSJDB(name.value,phone.value,passwordValue);
				} else {
					updateRequestNSJDB(name.value,phone.value,passwordValue);
				}
		 }
  }
		//初始化深职院view
		function initSZYView(view) {
			mValidView.onclick = function() {
				mValidView.className = 'footer-sub white-list-valid active';
				mNotActiveView.className = 'footer-sub white-list-not-act';
				mStopView.className = 'footer-sub white-list-stop';
				mStatus = 1;
			}
			mNotActiveView.onclick = function() {
				mValidView.className = 'footer-sub white-list-valid';
				mNotActiveView.className = 'footer-sub white-list-not-act active';
				mStopView.className = 'footer-sub white-list-stop';
				mStatus = 3;
			}
			mStopView.onclick = function() {
				mValidView.className = 'footer-sub white-list-valid';
				mNotActiveView.className = 'footer-sub white-list-not-act';
				mStopView.className = 'footer-sub white-list-stop active';
				mStatus = 2;
			}
			//输入内容的布局
			view.innerHTML = '<div class="main-sub">' + '<div class="main-sub-c1">' + '<div class="main-sub-contnet main-input-title">姓&emsp;名:</div>' + '</div>' + '<div class="main-sub-c2">' + '<div class="main-sub-contnet main-input-box"><input class="main-input szy-name" type="text" placeholder="输入姓名"/></div>' + '</div>' + '</div>' + '<div class="main-sub">' + '<div class="main-sub-c1">' + '<div class="main-sub-contnet main-input-title">身&emsp;份:</div>' + '</div>' + '<div class="main-sub-c2">' + '<div class="main-sub-contnet main-input-box"><input class="main-input szy-identity" type="text" placeholder="老师" readonly="true" value="老师"/></div>' + '</div>' + '</div>' + '<div class="main-sub">' + '<div class="main-sub-c1">' + '<div class="main-sub-contnet main-input-title">工&emsp;号:</div>' + '</div>' + '<div class="main-sub-c2">' + '<div class="main-sub-contnet main-input-box"><input class="main-input szy-jobnumber" type="text" placeholder="输入工号或学生号"/></div>' + '</div>' + '</div>' + '<div class="main-sub">' + '<div class="main-sub-c1">' + '<div class="main-sub-contnet main-input-title">证&nbsp;8&nbsp;号:</div>' + '</div>' + '<div class="main-sub-c2">' + '<div class="main-sub-contnet main-input-box"><input class="main-input szy-idcard" type="text" placeholder="输入身份证后八位"/></div>' + '</div>' + '</div>' + '<div class="main-sub">' + '<div class="main-sub-c1">' + '<div class="main-sub-contnet main-input-title">有效期:</div>' + '</div>' + '<div class="main-sub-c2">' + '<div class="main-sub-contnet main-input-box"><input id="valid-time" class="main-input szy-time" type="text" placeholder="输入有效期" readonly="true"/></div>' + '</div>' + '</div>';
			var commit = document.getElementById('btn-commit');
			//工号
			var gh = view.getElementsByClassName('szy-jobnumber')[0];
			//名字
			var name = view.getElementsByClassName('szy-name')[0];
			//身份
			var identiy = view.getElementsByClassName('szy-identity')[0];
			//有效时间
			var validTime = view.getElementsByClassName('szy-time')[0];
			//身份证后后八位
			var idcard = view.getElementsByClassName('szy-idcard')[0];
			//mDatas是否为null,是“新增页面”,反之为“更新页面”
			if (mDatas != null) {
				gh.value = dataFaultTolerant(mDatas.verify_code);
				name.value = dataFaultTolerant(mDatas.name);
				identiy.value = dataFaultTolerant(mDatas.type);
				validTime.value = dataFaultTolerant(mDatas.valid_time);
				idcard.value = dataFaultTolerant(mDatas.id_card);
				//状态，用以判断初始状态，来显示不同的初始view(状态)
				var status = mDatas.status;
				if (status == 3) {
					mNotActiveView.onclick();
				} else if (status == 1) {
					mValidView.onclick();
				} else if (status == 2) {
					mStopView.onclick();
				}
			} else {
				mValidView.onclick();
			}
			//点击“输入有效时间”，调用日历模块，显示日历。
			validTime.onclick = function() {
				dateView();
			}
			//是否显示了“身份”选择框
			var isShowID = false;
			//点击“身份”，弹出身份选择框.
			identiy.onclick = function() {
				isShowID = true;
				//是否第一次点击“身份”
				var isFirstClick = true;
				//是否点击了“身份选择框”
				var isClickPop = false;
				var bodyhtml = document.getElementsByTagName('body')[0];
				var popHtml = document.createElement('div');
				popHtml.className = 'identity-select-view';
				popHtml.innerHTML = '<div class="identity-select-view-sub">老师</div>' + '<div class="identity-select-view-sub">学生</div>';
				var laoshi = popHtml.getElementsByClassName('identity-select-view-sub')[0];
				var xuesheng = popHtml.getElementsByClassName('identity-select-view-sub')[1];
				laoshi.onclick = function() {
					isClickPop = true;
					identiy.value = '老师';
					bodyhtml.removeChild(bodyhtml.getElementsByClassName('identity-select-view')[0]);
				}
				xuesheng.onclick = function() {
					isClickPop = true;
					identiy.value = '学生';
					bodyhtml.removeChild(bodyhtml.getElementsByClassName('identity-select-view')[0]);
				}
				//设置弹窗的位置和宽
				var referenceLocation = document.getElementsByClassName('main-sub-c2')[1];
				var w = referenceLocation.offsetWidth;
				var t = referenceLocation.offsetTop;
				var l = referenceLocation.offsetLeft;
				popHtml.style.width = w + 'px';
				popHtml.style.left = l + 'px';
				popHtml.style.top = t + 'px';
				document.onclick = function() {
					console.log('dc');
					console.log('isClickPop=' + isClickPop + '  isFirstClick=' + isFirstClick);
					if (!isClickPop) {
						if (isFirstClick) {
							isFirstClick = false;
						} else {
							if (isShowID) {
								var mustCloseView = bodyhtml.getElementsByClassName('identity-select-view');
								if (mustCloseView.length != 0) {
									bodyhtml.removeChild(mustCloseView[0]);
								}
							}
							isClickPop = false;
						}
					}
				}
				bodyhtml.appendChild(popHtml);
			}
			//点击“保存”，读取输入数据，执行更新或添加方法。
			commit.onclick = function() {
				var ghContent = gh.value;
				var nameContent = name.value;
				var identiyContent = identiy.value;
				var validTimeContent = validTime.value;
				var idcardContent = idcard.value;
				if (ghContent == '') {
					api.toast({
						msg : '工号输入不能为空'
					});
					return;
				}
				if (nameContent == '') {
					api.toast({
						msg : '名字输入不能为空'
					});
					return;
				}
				if (validTimeContent == '' || validTimeContent == '--') {
					api.toast({
						msg : '有效时间输入有误'
					});
					return;
				}
				if (idcardContent == '') {
					api.toast({
						msg : '身份证后八位输入不能为空'
					});
					return;
				}
				//更新请求
				updateRequest(ghContent, nameContent, identiyContent, validTimeContent, idcardContent);
			}
		}

		//深职院更新和添加请求
		function updateRequest(gh,name,identiy,validTime,pwd) {
			api.showProgress({
			});
			var id;
			if (mDatas != null) {
				id = mDatas.id;
				mDatas.id_card = pwd;
				mDatas.type = identiy;
				mDatas.valid_time = validTime;
				mDatas.verify_code = gh;
				mDatas.name = name;
				mDatas.status = mStatus;
			}
			whiteListManage.addOrUpdateUserInfo(id, identiy, gh, name, pwd, validTime, mStatus, function(result) {
				api.hideProgress();
				console.log('更新或添加的结果---' + JSON.stringify(result));
				if (result) {
					var code = result.code;
					var msg = result.msg;
					if (code == 0) {
						api.toast({
							msg : msg
						});
					} else if (code == 1) {
						api.toast({
							msg : '添加成功'
						});
						api.sendEvent({
							name : 'updateWhiteListItem',
							extra : mDatas
						});
						setTimeout(function() {
							api.closeWin({
							});
						}, 300);
					} else if (code == 2) {
						api.sendEvent({
							name : 'updateWhiteListItem',
							extra : mDatas
						});
						api.toast({
							msg : '更新成功'
						});
						setTimeout(function() {
							api.closeWin({
							});
						}, 300);
					} else if (code == -1) {
						api.toast({
							msg : msg
						});
					}
				} else {
					api.toast({
						msg : '连接服务器失败'
					});
				}
			});
		}

		function add2callback(result) {
 		 api.hideProgress();
 		 console.log('南山街道办添加的结果---' + JSON.stringify(result));
 		 if (result) {
 			 var code = result.code;
 			 var msg = result.msg;
 			 if (code == 1) {
 				 api.toast({
 					 msg : '添加成功'
 				 });
 				 setTimeout(function() {
 					 api.closeWin({
 					 });
 				 }, 300);
 			 } else if (code == 0) {
 				 api.toast({
 					 msg : '添加失败'
 				 });
 			 } else if (code == -1) {
 				 api.toast({
 					 msg : '名字不能为空'
 				 });
 			 } else if (code == 2) {
 				 api.toast({
 					 msg : '白名单中已经有该人员，请勿重复添加。'
 				 });
 			 }
 		 } else {
 			 api.toast({
 				 msg : '连接服务器失败'
 			 });
 		 }
 	 }

		//南山街道办添加请求(龙华街道办，蔡屋围)
		function addRequestNSJDB(name, phone,password) {
			if (name == '') {
				api.toast({
					msg : '输入名字不能为空'
				});
				return;
			}
			if (phone == '') {
				api.toast({
					msg : '输入手机号不能为空'
				});
				return;
			}
			if(areaID == AREAID_CWW){
				if(password == ''){
					api.toast({
						msg : '输入密码不能为空'
					});
					return;
				}
				if (phone.length != 11) {
					api.toast({
						msg : '手机号码的个数是11位'
					});
					return;
				}
			}
			api.showProgress({
			});
			console.log('name=' + name + 'status=' + mStatus + '   userid=' + phone+' password'+password);
			whiteListManage.add2(name, mStatus, areaID, phone,password,add2callback);
		}

		//南山街道办更新请求
		function updateRequestNSJDB(name, phone,password) {
			api.showProgress({
			});
			if (name === '') {
				api.toast({
					msg : '输入名字不能为空'
				});
				return;
			}
			if (phone === '') {
				api.toast({
					msg : '输入手机号不能为空'
				});
				return;
			}

			if(areaID == AREAID_CWW){
				if(password == ''){
					api.toast({
						msg : '输入密码不能为空'
					});
					return;
				}

				if (phone.length != 11) {
					api.toast({
						msg : '手机号码的个数是11位'
					});
					return;
				}

			}

			mDatas.user_name = name;
			mDatas.user_phone = phone;
			mDatas.status = mStatus;
			console.log('name=' + name + 'status=' + mStatus + '   userid=' + phone+' password'+password);
			whiteListManage.update2(mDatas.id,name,phone,mStatus,password,function(result) {
				api.hideProgress();
				console.log('南山街道办更新的结果---' + JSON.stringify(result));
				if (result) {
					var code = result.code;
					var msg = result.msg;
					if (code == 1) {
						api.sendEvent({
							name : 'updateWhiteListItem',
							extra : mDatas
						});
						api.toast({
							msg : '更新成功'
						});
						api.closeWin({
						});
					} else {
						api.toast({
							msg : '更新失败'
						});
					}
				} else {
					api.toast({
						msg : '连接服务器失败'
					});
				}
			});
		}

		//日历时间
		function dateView() {
			var end = {
				elem : '#valid-time',
				format : 'YYYY/MM/DD hh:mm:ss',
				min : laydate.now(), //设定最小日期为当前日期
				max : '2099-06-16 23:59:59', //最大日期
				istime : true,
				istoday : false,
				choose : function(datas) {
					end.min = datas;
					//开始日选好后，重置结束日的最小日期
					end.start = datas;
					//将结束日的初始值设定为开始日
				}
			};
			laydate(end);
		}

	</script>
</html>
